#ifndef _STENCIL_H_

#define _STENCIL_H_

#include "scalarField.h"
#include "vectorField.h"
#include "tmp.h"

namespace pavan{

 template< class itype , class dtype , int dim , int Left , int Right >
    class interiorStencilBase 
 {
    public:
    interiorStencilBase() {;}

    /// Apply the given stencil on a scalar field uniformly in all i,j,k,....
    template<int dir> tmp< scalarPointField<itype,dtype,dim> >
       applyStencil( scalarPointField<itype,dtype,dim> &F );

    /// Apply the given stencil on a vector field uniformly in all i,j,k,....
    template<int dir,int N> tmp< vectorPointField<itype,dtype,dim,N> >
       applyStencil( vectorPointField<itype,dtype,dim,N> &F );

    void setCoeff( dtype *coeff ){
      int size = Left + Right + 1;
      std::cout << "Coeffs are [ " ;
      for( int i = 0 ; i < size ; ++i ){
        _coeff[i] = coeff[i];
        std::cout << _coeff[i] << "  ";
      }
      std::cout << "]\n";
    }
    
    protected:
    dtype _coeff[dim];

 };

 template< class itype , class dtype , int dim , int Left , int Right >
    class interiorStencil : public interiorStencilBase<itype,dtype,dim,Left,Right>
 {
    public:
    interiorStencil() {;}

 };

/// Class member specialization
#include "stencilImp2D.h"
#include "stencilImp3D.h"

}

#endif

